import Mock from 'mockjs'
import { MockList } from 'graphql-tools'
import MockUser from './user'
import MockProject from './projects'
import MockProjectClass from './projectClass'
import MockProjectLableView from './projectLabelView'
import MockImageItemInfo from './imageItemInfo'
import MockImage from './image'
import MockImageItem from './imageItem'
import MockImageItemAnnotation from './imageItemAnnotation'

const { Random } = Mock
const min = 100
const max = 99999
export default {
  Query: () => ({
    itemsPage: () => new MockList([1, 5]),
  }),
  Mutation: () => ({
    newLabel: () => ({
      description: Random.ctitle(3, 5),
      class_id: (root, args, context, info) => info.variableValues.title,
      interior: [],
      exterior: (root, args, context, info) => info.variableValues.points,
      tags: [],
    }),
  }),
  Int: () => Random.natural(min, max),
  Float: () => Random.float(0, 1080),
  String: () => Random.ctitle(10, 5),
  Date: () => Random.time(),
  User: MockUser,
  Project: MockProject,
  ProjectClasses: MockProjectClass,
  ProjectLabelView: MockProjectLableView,
  ImageItemInfo: MockImageItemInfo,
  ImageItemAnnotation: MockImageItemAnnotation,
  Image: MockImage,
  ImageItem: MockImageItem,
}
